﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace mars_server.csharp.Util
{
    class XmlUtil
    {
        public static string GetXmlNodeValue(string nodeName)
        {
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.Load("../../config/ipconfig.xml");
            XmlNode xn = xmldoc.SelectSingleNode("ipconfig");
            XmlNodeList xnl = xn.ChildNodes;
            foreach(XmlNode xn2 in xnl)
            {
                if (xn2.Name.Equals(nodeName))
                {
                    return xn2.InnerText;
                }
            }
            return "";

        }
    }
}
